package com.scalar.chiptrack.sales.actions.quote;

import com.scalar.chiptrack.ChipTracActionCommand;
import com.scalar.chiptrack.utils.ISubAction;

/**
 * User: ganesh
 * Date: May 13, 2008
 * Time: 5:51:44 PM
 */
public class PreviousQuotationLatestPriceSearchCommandFactory {
    private static PreviousQuotationLatestPriceSearchCommandFactory commandFactory;

       private PreviousQuotationLatestPriceSearchCommandFactory()
       {

       }

       public static synchronized PreviousQuotationLatestPriceSearchCommandFactory getInstance()
       {
           if(commandFactory == null)
           {
               commandFactory = new PreviousQuotationLatestPriceSearchCommandFactory();
           }
           return commandFactory;
       }

    public ChipTracActionCommand getActionCommand(String action)
    {
        ChipTracActionCommand actionCommand=null;
        if(action.equalsIgnoreCase(ISubAction.CHIPTRAC_PREVIOUS_QUOTATION_LATESTPRICE_SEARCH))
        {
           actionCommand=new PreviousQuotationLatestPriceSearchActionCommand();
        }
        else if(action.equalsIgnoreCase(ISubAction.CHIPTRAC_PREVIOUS_QUOTATION_LATESTPRICE_SEARCH_SORT))
        {
           actionCommand=new PreviousQuotationLatestPriceSearchSortCommand();
        }
        else if(action.equalsIgnoreCase(ISubAction.CHIPTRAC_PREVIOUS_QUOTATION_LATESTPRICE_SEARCH_SCROLL))
        {
           actionCommand=new PreviousQuotationLatestPriceSearchScrollCommand();
        }
        return actionCommand;

    }

}
